package com.du.cloud.security.exception;

import com.du.cloud.security.component.CustomAuth2ExceptionSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

/**
 * Desc:
 * Author: dushuang
 * Date: 2020/5/26
 **/
@JsonSerialize(using = CustomAuth2ExceptionSerializer.class)
public class CustomAuth2Exception extends OAuth2Exception {

    @Getter
    private String errorCode;

    public CustomAuth2Exception(String message){
        super(message);
    }

    public CustomAuth2Exception(String message, Throwable t){
        super(message, t);
    }

    public CustomAuth2Exception(String message, String errorCode){
        super(message);
        this.errorCode = errorCode;
    }
}
